;Assembler header file for OSFile
;written by DefMod (Dec 31 2005) on Sat Dec 31 14:01:38 2005
;Jonathan Coxhead, jonathan@doves.demon.co.uk, 21 Aug 1995

        [       :LNOT: :DEF: OSFile_Hdr
        GBLS    OSFile_Hdr

        [       :LNOT: :DEF: Get_Types
        GBLS    Get_Types
        ]
        [       :LNOT: :DEF: Types_Hdr
Get_Types                       SETS    "GET oslib/Types.Hdr"
        |
Get_Types                       SETS    ""
        ]
        $Get_Types

        [       :LNOT: :DEF: Get_OS
        GBLS    Get_OS
        ]
        [       :LNOT: :DEF: OS_Hdr
Get_OS                          SETS    "GET oslib/OS.Hdr"
        |
Get_OS                          SETS    ""
        ]
        $Get_OS

        [       :LNOT: :DEF: Get_FileSwitch
        GBLS    Get_FileSwitch
        ]
        [       :LNOT: :DEF: FileSwitch_Hdr
Get_FileSwitch                  SETS    "GET oslib/FileSwitch.Hdr"
        |
Get_FileSwitch                  SETS    ""
        ]
        $Get_FileSwitch

;Symbols for constants
OSFile_NotFound                 *       &0
OSFile_IsFile                   *       &1
OSFile_IsDir                    *       &2
OSFile_IsImage                  *       &3
OSFile_FileType                 *       &FFF00
OSFile_FileTypeShift            *       8
OSFile_TypeDraw                 *       &AFF
OSFile_TypeBBCROM               *       &BBC
OSFile_TypeCode                 *       &F95
OSFile_TypeResource             *       &FAE
OSFile_TypeDOSDisc              *       &FC8
OSFile_TypeDevice               *       &FCC
OSFile_TypeCache                *       &FCF
OSFile_TypeTaskExec             *       &FD6
OSFile_TypeTaskObey             *       &FD7
OSFile_TypeDOS                  *       &FE4
OSFile_TypeDesktop              *       &FEA
OSFile_TypeObey                 *       &FEB
OSFile_TypeTemplate             *       &FEC
OSFile_TypePalette              *       &FED
OSFile_TypeConfig               *       &FF2
OSFile_TypePrintout             *       &FF4
OSFile_TypePostscript           *       &FF5
OSFile_TypeFont                 *       &FF6
OSFile_TypeBBCFont              *       &FF7
OSFile_TypeAbsolute             *       &FF8
OSFile_TypeSprite               *       &FF9
OSFile_TypeModule               *       &FFA
OSFile_TypeBASIC                *       &FFB
OSFile_TypeUtility              *       &FFC
OSFile_TypeData                 *       &FFD
OSFile_TypeCommand              *       &FFE
OSFile_TypeText                 *       &FFF
OSFile_TypeDir                  *       &1000
OSFile_TypeApplication          *       &2000
OSFile_TypeUntyped              *       &FFFFFFFF

;Symbols for SWI's and SWI reason codes
XOS_File                        *       &20008
OS_File                         *       &8

OSFile_SaveStamped              *       &A
   ;Entry
   ;  R0 = &A
   ;  R1 -> file_name (String)
   ;  R2 = file_type (Bits)
   ;  R4 -> data (data)
   ;  R5 -> end (data)

OSFile_Write                    *       &1
   ;Entry
   ;  R0 = &1
   ;  R1 -> file_name (String)
   ;  R2 = load_addr (Bits)
   ;  R3 = exec_addr (Bits)
   ;  R5 = attr (FileSwitch_Attr)

OSFile_WriteLoad                *       &2
   ;Entry
   ;  R0 = &2
   ;  R1 -> file_name (String)
   ;  R2 = load_addr (Bits)

OSFile_WriteExec                *       &3
   ;Entry
   ;  R0 = &3
   ;  R1 -> file_name (String)
   ;  R3 = exec_addr (Bits)

OSFile_WriteAttr                *       &4
   ;Entry
   ;  R0 = &4
   ;  R1 -> file_name (String)
   ;  R5 = attr (FileSwitch_Attr)

OSFile_Stamp                    *       &9
   ;Entry
   ;  R0 = &9
   ;  R1 -> file_name (String)

OSFile_SetType                  *       &12
   ;Entry
   ;  R0 = &12
   ;  R1 -> file_name (String)
   ;  R2 = file_type (Bits)

OSFile_Delete                   *       &6
   ;Entry
   ;  R0 = &6
   ;  R1 -> file_name (String)
   ;Exit
   ;  R0 = obj_type (FileSwitch_ObjectType)
   ;  R2 = load_addr (Bits)
   ;  R3 = exec_addr (Bits)
   ;  R4 = size (Int)
   ;  R5 = attr (FileSwitch_Attr)

OSFile_CreateStamped            *       &B
   ;Entry
   ;  R0 = &B
   ;  R1 -> file_name (String)
   ;  R2 = file_type (Bits)
   ;  R4 = &0
   ;  R5 = size (Int)

OSFile_CreateDir                *       &8
   ;Entry
   ;  R0 = &8
   ;  R1 -> dir_name (String)
   ;  R4 = entry_count (Int)

OSFile_LoadStamped              *       &FF
   ;Entry
   ;  R0 = &FF
   ;  R1 -> file_name (String)
   ;  R2 = addr (pointer to data)
   ;  R3 = &0
   ;Exit
   ;  R0 = obj_type (FileSwitch_ObjectType)
   ;  R2 = load_addr (Bits)
   ;  R3 = exec_addr (Bits)
   ;  R4 = size (Int)
   ;  R5 = attr (FileSwitch_Attr)

OSFile_LoadStampedPath          *       &C
   ;Entry
   ;  R0 = &C
   ;  R1 -> file_name (String)
   ;  R2 = addr (pointer to data)
   ;  R3 = &0
   ;  R4 -> path (String)
   ;Exit
   ;  R0 = obj_type (FileSwitch_ObjectType)
   ;  R2 = load_addr (Bits)
   ;  R3 = exec_addr (Bits)
   ;  R4 = size (Int)
   ;  R5 = attr (FileSwitch_Attr)

OSFile_LoadStampedPathVar       *       &E
   ;Entry
   ;  R0 = &E
   ;  R1 -> file_name (String)
   ;  R2 = addr (pointer to data)
   ;  R3 = &0
   ;  R4 -> var (String)
   ;Exit
   ;  R0 = obj_type (FileSwitch_ObjectType)
   ;  R2 = load_addr (Bits)
   ;  R3 = exec_addr (Bits)
   ;  R4 = size (Int)
   ;  R5 = attr (FileSwitch_Attr)

OSFile_LoadStampedNoPath        *       &10
   ;Entry
   ;  R0 = &10
   ;  R1 -> file_name (String)
   ;  R2 = addr (pointer to data)
   ;  R3 = &0
   ;Exit
   ;  R0 = obj_type (FileSwitch_ObjectType)
   ;  R2 = load_addr (Bits)
   ;  R3 = exec_addr (Bits)
   ;  R4 = size (Int)
   ;  R5 = attr (FileSwitch_Attr)

OSFile_MakeError                *       &13
   ;Entry
   ;  R0 = &13
   ;  R1 -> file_name (String)
   ;  R2 = obj_type (FileSwitch_ObjectType)

OSFile_ReadStamped              *       &14
   ;Entry
   ;  R0 = &14
   ;  R1 -> file_name (String)
   ;Exit
   ;  R0 = obj_type (FileSwitch_ObjectType)
   ;  R2 = load_addr (Bits)
   ;  R3 = exec_addr (Bits)
   ;  R4 = size (Int)
   ;  R5 = attr (FileSwitch_Attr)
   ;  R6 = file_type (Bits)

OSFile_ReadStampedPath          *       &15
   ;Entry
   ;  R0 = &15
   ;  R1 -> file_name (String)
   ;  R4 -> path (String)
   ;Exit
   ;  R0 = obj_type (FileSwitch_ObjectType)
   ;  R2 = load_addr (Bits)
   ;  R3 = exec_addr (Bits)
   ;  R4 = size (Int)
   ;  R5 = attr (FileSwitch_Attr)
   ;  R6 = file_type (Bits)

OSFile_ReadStampedPathVar       *       &16
   ;Entry
   ;  R0 = &16
   ;  R1 -> file_name (String)
   ;  R4 -> var (String)
   ;Exit
   ;  R0 = obj_type (FileSwitch_ObjectType)
   ;  R2 = load_addr (Bits)
   ;  R3 = exec_addr (Bits)
   ;  R4 = size (Int)
   ;  R5 = attr (FileSwitch_Attr)
   ;  R6 = file_type (Bits)

OSFile_ReadStampedNoPath        *       &17
   ;Entry
   ;  R0 = &17
   ;  R1 -> file_name (String)
   ;Exit
   ;  R0 = obj_type (FileSwitch_ObjectType)
   ;  R2 = load_addr (Bits)
   ;  R3 = exec_addr (Bits)
   ;  R4 = size (Int)
   ;  R5 = attr (FileSwitch_Attr)
   ;  R6 = file_type (Bits)

OSFile_ReadBlockSize            *       &18
   ;Entry
   ;  R0 = &18
   ;  R1 -> file_name (String)
   ;Exit
   ;  R2 = block_size (Int)

OSFile_Save                     *       &0
   ;Entry
   ;  R0 = &0
   ;  R1 -> file_name (String)
   ;  R2 = load_addr (Bits)
   ;  R3 = exec_addr (Bits)
   ;  R4 -> data (data)
   ;  R5 -> end (data)

OSFile_Read                     *       &5
   ;Entry
   ;  R0 = &5
   ;  R1 -> file_name (String)
   ;Exit
   ;  R0 = obj_type (FileSwitch_ObjectType)
   ;  R2 = load_addr (Bits)
   ;  R3 = exec_addr (Bits)
   ;  R4 = size (Int)
   ;  R5 = attr (FileSwitch_Attr)

OSFile_ReadPath                 *       &D
   ;Entry
   ;  R0 = &D
   ;  R1 -> file_name (String)
   ;  R4 -> path (String)
   ;Exit
   ;  R0 = obj_type (FileSwitch_ObjectType)
   ;  R2 = load_addr (Bits)
   ;  R3 = exec_addr (Bits)
   ;  R4 = size (Int)
   ;  R5 = attr (FileSwitch_Attr)

OSFile_ReadPathVar              *       &F
   ;Entry
   ;  R0 = &F
   ;  R1 -> file_name (String)
   ;  R4 -> var (String)
   ;Exit
   ;  R0 = obj_type (FileSwitch_ObjectType)
   ;  R2 = load_addr (Bits)
   ;  R3 = exec_addr (Bits)
   ;  R4 = size (Int)
   ;  R5 = attr (FileSwitch_Attr)

OSFile_ReadNoPath               *       &11
   ;Entry
   ;  R0 = &11
   ;  R1 -> file_name (String)
   ;Exit
   ;  R0 = obj_type (FileSwitch_ObjectType)
   ;  R2 = load_addr (Bits)
   ;  R3 = exec_addr (Bits)
   ;  R4 = size (Int)
   ;  R5 = attr (FileSwitch_Attr)

OSFile_Create                   *       &7
   ;Entry
   ;  R0 = &7
   ;  R1 -> file_name (String)
   ;  R2 = load_addr (Bits)
   ;  R3 = exec_addr (Bits)
   ;  R4 = &0
   ;  R5 = size (Int)

OSFile_Load                     *       &FF
   ;Entry
   ;  R0 = &FF
   ;  R1 -> file_name (String)
   ;  R3 = &1
   ;Exit
   ;  R0 = obj_type (FileSwitch_ObjectType)
   ;  R2 = load_addr (Bits)
   ;  R3 = exec_addr (Bits)
   ;  R4 = size (Int)
   ;  R5 = attr (FileSwitch_Attr)

OSFile_LoadPath                 *       &C
   ;Entry
   ;  R0 = &C
   ;  R1 -> file_name (String)
   ;  R3 = &1
   ;  R4 -> path (String)
   ;Exit
   ;  R0 = obj_type (FileSwitch_ObjectType)
   ;  R2 = load_addr (Bits)
   ;  R3 = exec_addr (Bits)
   ;  R4 = size (Int)
   ;  R5 = attr (FileSwitch_Attr)

OSFile_LoadPathVar              *       &E
   ;Entry
   ;  R0 = &E
   ;  R1 -> file_name (String)
   ;  R3 = &1
   ;  R4 -> var (String)
   ;Exit
   ;  R0 = obj_type (FileSwitch_ObjectType)
   ;  R2 = load_addr (Bits)
   ;  R3 = exec_addr (Bits)
   ;  R4 = size (Int)
   ;  R5 = attr (FileSwitch_Attr)

OSFile_LoadNoPath               *       &10
   ;Entry
   ;  R0 = &10
   ;  R1 -> file_name (String)
   ;  R3 = &1
   ;Exit
   ;  R0 = obj_type (FileSwitch_ObjectType)
   ;  R2 = load_addr (Bits)
   ;  R3 = exec_addr (Bits)
   ;  R4 = size (Int)
   ;  R5 = attr (FileSwitch_Attr)

FileV                           *       &8

UpCallFile_Save                 *       &0
   ;Entry
   ;  R0 = &3
   ;  R1 -> file_name (String)
   ;  R2 = load_addr (Bits)
   ;  R3 = exec_addr (Bits)
   ;  R4 -> data (data)
   ;  R5 -> end (data)
   ;  R6 -> special (String)
   ;  R8 = fs_info (FileSwitch_FSInfo)
   ;  R9 = &0

UpCallFile_SetArgs              *       &1
   ;Entry
   ;  R0 = &3
   ;  R1 -> file_name (String)
   ;  R2 = load_addr (Bits)
   ;  R3 = exec_addr (Bits)
   ;  R5 = attr (FileSwitch_Attr)
   ;  R6 -> special (String)
   ;  R8 = fs_info (FileSwitch_FSInfo)
   ;  R9 = &1

UpCallFile_SetLoadAddr          *       &2
   ;Entry
   ;  R0 = &3
   ;  R1 -> file_name (String)
   ;  R2 = load_addr (Bits)
   ;  R6 -> special (String)
   ;  R8 = fs_info (FileSwitch_FSInfo)
   ;  R9 = &2

UpCallFile_SetExecAddr          *       &3
   ;Entry
   ;  R0 = &3
   ;  R1 -> file_name (String)
   ;  R3 = exec_addr (Bits)
   ;  R6 -> special (String)
   ;  R8 = fs_info (FileSwitch_FSInfo)
   ;  R9 = &3

UpCallFile_SetAttr              *       &4
   ;Entry
   ;  R0 = &3
   ;  R1 -> file_name (String)
   ;  R5 = attr (FileSwitch_Attr)
   ;  R6 -> special (String)
   ;  R8 = fs_info (FileSwitch_FSInfo)
   ;  R9 = &4

UpCallFile_Delete               *       &6
   ;Entry
   ;  R0 = &3
   ;  R1 -> file_name (String)
   ;  R6 -> special (String)
   ;  R8 = fs_info (FileSwitch_FSInfo)
   ;  R9 = &6

UpCallFile_Create               *       &7
   ;Entry
   ;  R0 = &3
   ;  R1 -> file_name (String)
   ;  R2 = load_addr (Bits)
   ;  R3 = exec_addr (Bits)
   ;  R4 -> data (data)
   ;  R5 -> end (data)
   ;  R6 -> special (String)
   ;  R8 = fs_info (FileSwitch_FSInfo)
   ;  R9 = &7

UpCallFile_CreateDir            *       &8
   ;Entry
   ;  R0 = &3
   ;  R1 -> file_name (String)
   ;  R2 = load_addr (Bits)
   ;  R3 = exec_addr (Bits)
   ;  R4 = entry_count (Int)
   ;  R6 -> special (String)
   ;  R8 = fs_info (FileSwitch_FSInfo)
   ;  R9 = &8

        ]
        END
